﻿using System;
using System.Collections.Generic;
using System.Text;
using Cosmos.Hardware;

namespace _3DOS
{
    class ISOGrid
    {
        public static uint[] yaxis = { 
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0
                          };
        public static uint[] xaxis = { 
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
                          };
        public static uint[] zaxis = { 
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                          1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
                          };
        
        public static void draw(uint x, uint y)
        {
            DrawText(yaxis, 17, 16, 4, x, y);
            DrawText(xaxis, 17, 16, 2, x, y);
            DrawText(zaxis, 17, 16, 11, x, y);
        }
        public static void DrawText(uint[] Arr, int width, int length, uint tcolor, uint x, uint y)
        {
            uint i;
            uint t;
            int count = 0;

            for (i = 0; i < length; i++)
            {
                for (t = 0; t < width; t++, count++)
                {
                    if (Arr[count] == 1)
                    {
                        VGAScreen.SetPixel320x200x8(x + t, y + i, tcolor);

                    }

                }
            }
        }
    }
}
